//
//  CCPartyCellViewModel.m
//  Party
//
//  Created by its on 15/3/12.
//  Copyright (c) 2015年 coco. All rights reserved.
//

#import "CCPartyCellViewModel.h"
#import "CCDevice.h"


@interface CCPartyCellViewModel ()
@end

@implementation CCPartyCellViewModel
- (id)initWithModel:(CCPartyCellModel *)model {
  if (self = [super init]) {
    _headURL = [NSURL URLWithString:model.author.headImage];
    _name = [[NSAttributedString alloc] initWithString:model.author.nickName attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]
                                                                                            }];
    _heard = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:
                                                         @"%@",model.followCount]
                                             attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]
                                                          }];
    _bgURL = [NSURL URLWithString:model.coverImage];
    _title = [[NSAttributedString alloc] initWithString:model.title attributes:nil];
    _people = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:
                                                          @"%@",model.applyCount]
                                              attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]
                                                           }];
    _peopleImage = [UIImage imageNamed:@"a_people"];
    _money = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:
                                                          @"%@",model.money]
                                             attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]
                                                          }];
    _moneyImage = [UIImage imageNamed:@"a_money"];
    _address = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:
                                                         @"%@",model.address]
                                               attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]
                                                            }];
    _addressImage = [UIImage imageNamed:@"a_address"];
    _time = [[NSAttributedString alloc] initWithString: model.activityTime
                                            attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]
                                                         }];
    _timeImage = [UIImage imageNamed:@"a_door"];
  }
  return self;
}

@end
